﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/teleweb/common/global.jsp" %>

<%
	String sStatus=request.getParameter("status"); 
	String sPagerId="publish_pager";
	if(sStatus.equals("0")) {
		sPagerId="pending_pager";
	}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>中国通信服务</title>
<link href="teleweb/css/ztf.css" rel="stylesheet" type="text/css" />
<link href="teleweb/css/roll.css" rel="stylesheet" type="text/css" />
<link href="teleweb/css/content.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/js/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="${ctx}/teleweb/js/submitFunctions.js"></script>
</head>
<body>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <!-- 主体table -->
  <%request.setAttribute("panel","QA");%>
  <%@ include file="/teleweb/common/include/header.jsp" %>
        
  <tr>
    <!---首页内容--->
    <td class="new_indexcontent"><div class="new_stars">
        <div class="new_weizhi">你现在所在的位置：<a href="${ctx}/index">首页</a>><a href="${ctx}/listQuestionAnswer.action">员工问答</a></div>
      </div>
      <!---圆角--->
      <div class="box-cir3">
        <div class="t_l"></div>
        <div class="t_m"></div>
        <div class="t_r"></div>
        <div class="m_l"></div>
        <div class="m_m1">
          <!---标题内容--->
          <div class="new_heading1">
            <h3>员工问答</h3>
          </div>
          <c:if test="${!empty qa.resultList}">
				<c:forEach items="${qa.resultList}" var="qa">
					<div class="new_question">
          				<h3>问题</h3>
          				<h4>IP:${qa.userIp}</h4>
          				<p>${qa.question}</p>
          			</div>  
          			<div class="new_answer">
          				<h3><span class="new_answerword">回复</span><span class="new_answerdate">发布日期：${fn:substring(qa.publishDate, 0, 16)}</span></h3>
          				<p>${qa.answer}</p>
          			</div> 
          		</c:forEach>
			</c:if>
			<div class="new_order">
				<pg:pager id="<%=sPagerId%>" url="detailQuestionAnswer.action" maxPageItems="1" items="${qa.recordSum}" export="currentPageNumber=pageNumber">
					<pg:param name="pageSize" value="1"/>
					<pg:param name="status" value="<%=sStatus%>"/>
					<pg:prev ifnull="true">
						<% if (pageUrl != null) { %>   
		        			<a HREF="<%=pageUrl%>" class="new_lastone">上一问题</a>
		      			<% } else { %>   
		        			<span class="new_lastone">上一问题</span>
		      			<% } %>   
					</pg:prev>
					<pg:next ifnull="true">
						<% if (pageUrl != null) { %>   
		        			<a HREF="<%=pageUrl%>" class="new_nextone">下一问题</a>
		      			<% } else { %>   
		        			<span class="new_nextone">下一问题</span>
		      			<% } %> 
					</pg:next>
				</pg:pager>
          	</div>
            <!--问答-->
            <div class="new_questions">
            <div class="new_questionse">
            <h2>我要提问:</h2>
				    <s:form action ="addQuestionAnswer" method ="post" enctype ="multipart/form-data" id="addQAForm"> 
				        <textarea id="question" name ="question"></textarea> 
				        <div class="new_btform">    
				            <button class="new_btforml" onclick="submitAddQuestionAnswer(document.getElementById('addQAForm'));" >提交</button>
				            <button onclick="document.getElementById('addQAForm').reset();">重置</button>
				        </div>
				    </s:form > 
            </div>
            </div>
            </div>
        <div class="m_r"></div>
        <div class="b_l"></div>
        <div class="b_m"></div>
        <div class="b_r"></div>
      </div></td>
  </tr>
  <%@ include file="common/include/tail.jsp"%>
</table>
</body>
</html>
